package generator.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 用户余额流水表
 * @TableName customer_balance_record
 */
@TableName(value ="customer_balance_record")
public class CustomerBalanceRecord implements Serializable {
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 客户ID（关联customer_info.id）
     */
    private Long customerId;

    /**
     * 记录类型 1-充值 2-支出
     */
    private Integer recordType;

    /**
     * 变动金额（正数存储）
     */
    private BigDecimal amount;

    /**
     * 关联订单号（规则: 类型前缀+业务ID）
     */
    private String orderId;

    /**
     * 变动前余额
     */
    private BigDecimal beforeBalance;

    /**
     * 变动后余额
     */
    private BigDecimal afterBalance;

    /**
     * 渠道 1-微信 2-支付宝 3-银行卡
     */
    private Integer channel;

    /**
     * 状态 1-处理中 2-成功 3-失败
     */
    private Integer status;

    /**
     * 业务备注（如充值套餐名称）
     */
    private String remark;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 删除标识
     */
    private Integer isDeleted;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    public Long getId() {
        return id;
    }

    /**
     * 主键
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 客户ID（关联customer_info.id）
     */
    public Long getCustomerId() {
        return customerId;
    }

    /**
     * 客户ID（关联customer_info.id）
     */
    public void setCustomerId(Long customerId) {
        this.customerId = customerId;
    }

    /**
     * 记录类型 1-充值 2-支出
     */
    public Integer getRecordType() {
        return recordType;
    }

    /**
     * 记录类型 1-充值 2-支出
     */
    public void setRecordType(Integer recordType) {
        this.recordType = recordType;
    }

    /**
     * 变动金额（正数存储）
     */
    public BigDecimal getAmount() {
        return amount;
    }

    /**
     * 变动金额（正数存储）
     */
    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    /**
     * 关联订单号（规则: 类型前缀+业务ID）
     */
    public String getOrderId() {
        return orderId;
    }

    /**
     * 关联订单号（规则: 类型前缀+业务ID）
     */
    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    /**
     * 变动前余额
     */
    public BigDecimal getBeforeBalance() {
        return beforeBalance;
    }

    /**
     * 变动前余额
     */
    public void setBeforeBalance(BigDecimal beforeBalance) {
        this.beforeBalance = beforeBalance;
    }

    /**
     * 变动后余额
     */
    public BigDecimal getAfterBalance() {
        return afterBalance;
    }

    /**
     * 变动后余额
     */
    public void setAfterBalance(BigDecimal afterBalance) {
        this.afterBalance = afterBalance;
    }

    /**
     * 渠道 1-微信 2-支付宝 3-银行卡
     */
    public Integer getChannel() {
        return channel;
    }

    /**
     * 渠道 1-微信 2-支付宝 3-银行卡
     */
    public void setChannel(Integer channel) {
        this.channel = channel;
    }

    /**
     * 状态 1-处理中 2-成功 3-失败
     */
    public Integer getStatus() {
        return status;
    }

    /**
     * 状态 1-处理中 2-成功 3-失败
     */
    public void setStatus(Integer status) {
        this.status = status;
    }

    /**
     * 业务备注（如充值套餐名称）
     */
    public String getRemark() {
        return remark;
    }

    /**
     * 业务备注（如充值套餐名称）
     */
    public void setRemark(String remark) {
        this.remark = remark;
    }

    /**
     * 创建时间
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * 创建时间
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * 更新时间
     */
    public Date getUpdateTime() {
        return updateTime;
    }

    /**
     * 更新时间
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    /**
     * 删除标识
     */
    public Integer getIsDeleted() {
        return isDeleted;
    }

    /**
     * 删除标识
     */
    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        CustomerBalanceRecord other = (CustomerBalanceRecord) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getCustomerId() == null ? other.getCustomerId() == null : this.getCustomerId().equals(other.getCustomerId()))
            && (this.getRecordType() == null ? other.getRecordType() == null : this.getRecordType().equals(other.getRecordType()))
            && (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount()))
            && (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()))
            && (this.getBeforeBalance() == null ? other.getBeforeBalance() == null : this.getBeforeBalance().equals(other.getBeforeBalance()))
            && (this.getAfterBalance() == null ? other.getAfterBalance() == null : this.getAfterBalance().equals(other.getAfterBalance()))
            && (this.getChannel() == null ? other.getChannel() == null : this.getChannel().equals(other.getChannel()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCustomerId() == null) ? 0 : getCustomerId().hashCode());
        result = prime * result + ((getRecordType() == null) ? 0 : getRecordType().hashCode());
        result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode());
        result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
        result = prime * result + ((getBeforeBalance() == null) ? 0 : getBeforeBalance().hashCode());
        result = prime * result + ((getAfterBalance() == null) ? 0 : getAfterBalance().hashCode());
        result = prime * result + ((getChannel() == null) ? 0 : getChannel().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", customerId=").append(customerId);
        sb.append(", recordType=").append(recordType);
        sb.append(", amount=").append(amount);
        sb.append(", orderId=").append(orderId);
        sb.append(", beforeBalance=").append(beforeBalance);
        sb.append(", afterBalance=").append(afterBalance);
        sb.append(", channel=").append(channel);
        sb.append(", status=").append(status);
        sb.append(", remark=").append(remark);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", isDeleted=").append(isDeleted);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}